home *** CD-ROM | disk | FTP | other *** search
/ Enter 2010 January / ENTER_2010_01.iso / Programy / Gry / Base_Invaders_ / BaseInvadersSetup1.3.exe / {app} / Scripts / Campaign9Startup.lua < prev    next >
Encoding:
Text File  |  2007-01-25  |  10.0 KB  |  357 lines

  1. -- Army of invaders on the horizon
  2. function SquadCinematic()
  3.  
  4.     local CinemaInvader  = G.CreateAt( "Squad", Vector3( 130, 0, 130 ) );
  5.     Camera.CinemaMove( Vector3(80,30,80), Vector3(146,5,150), 2 );
  6.     --Camera.CinemaLookAt( CinemaInvader );
  7.     
  8.     CinemaInvader.TurnOffAI()
  9.     
  10.     CinemaInvader.SetDirection( Vector3( -1,0,-1 ) );
  11.     
  12.     -- Spiker appears:
  13.     G.SayPhraseScript( "Ten hut!" , CinemaInvader );
  14.  
  15.     local CinemaInvader2  = G.CreateAt( "Basic",     Vector3( 115, 0, 115 ) );
  16.     local CinemaInvader3  = G.CreateAt( "Basic",     Vector3( 125, 0, 120 ) );
  17.     local CinemaInvader4  = G.CreateAt( "Basic",     Vector3( 120, 0, 115 ) );
  18.     local CinemaInvader8  = G.CreateAt( "Basic",     Vector3( 115, 0, 120 ) );
  19.     local CinemaInvader9  = G.CreateAt( "Basic",     Vector3( 120, 0, 125 ) );
  20.     local CinemaInvader5  = G.CreateAt( "Miner",     Vector3( 110, 0, 110 ) );
  21.     local CinemaInvader15  = G.CreateAt( "Miner",     Vector3( 100, 0, 110 ) );
  22.     local CinemaInvader6  = G.CreateAt( "Spiker",    Vector3( 110, 0, 115 ) );
  23.     local CinemaInvader7  = G.CreateAt( "Spiker",    Vector3( 115, 0, 110 ) );
  24.     local CinemaInvader10  = G.CreateAt( "Driller",  Vector3( 115, 0, 105 ) );
  25.     local CinemaInvader11  = G.CreateAt( "Driller",  Vector3( 105, 0, 115 ) );
  26.     local CinemaInvader12  = G.CreateAt( "Ninja",    Vector3( 110, 0, 120 ) );
  27.     local CinemaInvader13  = G.CreateAt( "Ninja",    Vector3( 120, 0, 110 ) );
  28.     local CinemaInvader14  = G.CreateAt( "Kamikaze", Vector3( 100, 0, 100 ) );
  29.  
  30.     CinemaInvader.TurnOffAI();
  31.     CinemaInvader2.TurnOffAI();
  32.     CinemaInvader3.TurnOffAI();
  33.     CinemaInvader4.TurnOffAI();
  34.     CinemaInvader5.TurnOffAI();
  35.     CinemaInvader6.TurnOffAI();
  36.     CinemaInvader7.TurnOffAI();
  37.     CinemaInvader8.TurnOffAI();
  38.     CinemaInvader9.TurnOffAI();
  39.     CinemaInvader10.TurnOffAI();
  40.     CinemaInvader11.TurnOffAI();
  41.     CinemaInvader12.TurnOffAI();
  42.     CinemaInvader13.TurnOffAI();
  43.     CinemaInvader14.TurnOffAI();
  44.     CinemaInvader15.TurnOffAI();
  45.  
  46.     GameWait(3)
  47.     
  48.     G.SayPhraseScript( "Today we fight" , CinemaInvader );
  49.  
  50.     TraitorTalk( "Look! All the invaders are gathering on the hill." );
  51.  
  52.     GameWait(1)
  53.     G.SayPhraseScript( "We can win" , CinemaInvader );
  54.     GameWait(1)
  55.     G.SayPhraseScript( "Victory is ours" , CinemaInvader );
  56.     GameWait(1)
  57.     G.SayPhraseScript( "We will win" , CinemaInvader );
  58.     GameWait(1)
  59.     G.SayPhraseScript( "Destroy the \nTower!" , CinemaInvader );
  60.     GameWait(1)
  61.     G.SayPhraseScript( "Defeat the \nHand!" , CinemaInvader );
  62.  
  63.     TraitorTalk( "Squad Leaders? They're hardened troops that have survived an invasion." );
  64.  
  65.     GameWait(1)
  66.     G.SayPhraseScript( "We have fought" , CinemaInvader );
  67.     GameWait(1)
  68.     G.SayPhraseScript( "long and hard" , CinemaInvader );
  69.     GameWait(1)
  70.     G.SayPhraseScript( "but know today" , CinemaInvader );
  71.     GameWait(1)
  72.     G.SayPhraseScript( "we shall \ntriumph!" , CinemaInvader );
  73.     GameWait(3)
  74.         
  75.     
  76.     G.SayPhraseScript( "Fall in Troops!" , CinemaInvader );
  77.  
  78.     TraitorTalk( "Squad leaders increase other invaders' powers! Watch out!" );
  79.     GameWait(3)
  80.  
  81.  
  82.     TraitorTalk( "This isn't going to be easy ..." );
  83.  
  84.     G.SayPhraseScript( "Forward March!" , CinemaInvader );
  85.  
  86.     CinemaInvader.TurnOnAI()
  87.     CinemaInvader2.TurnOnAI();
  88.     CinemaInvader3.TurnOnAI();
  89.     CinemaInvader4.TurnOnAI();
  90.     CinemaInvader5.TurnOnAI();
  91.     CinemaInvader6.TurnOnAI();
  92.     CinemaInvader7.TurnOnAI();
  93.     CinemaInvader8.TurnOnAI();
  94.     CinemaInvader9.TurnOnAI();
  95.     CinemaInvader10.TurnOnAI();
  96.     CinemaInvader11.TurnOnAI();
  97.     CinemaInvader12.TurnOnAI();
  98.     CinemaInvader13.TurnOnAI();
  99.     CinemaInvader14.TurnOnAI();
  100.     CinemaInvader15.TurnOnAI();
  101.     
  102.     GameWait(1)
  103. end
  104.  
  105.  
  106.  
  107. --Common Level Start Code
  108. function LevelStartup()
  109.  
  110.     G.Create( "MenuData/HudCog.xml" );
  111.     G.Create( "Data/GameCamera.xml" );
  112.     G.Create( "Data/CursorCog.xml" );
  113.  
  114.     MainLevel = G.Create( "Data/Levels/Campaign9.xml" );
  115.     MainLevel.CreateLevel();
  116.  
  117.     G.SetInvSpeed( 20 );
  118.     HUD.EnterLevel();
  119.     G.SetGameState( InLevel );
  120.     G.SetPoints( 0 );
  121.     
  122.     G.SetLightTime( 5 );
  123.     G.PostP( "None" );
  124.     --TraitorTalk(" ");
  125.  
  126.     -- gameStartTime = 10000000;
  127.  
  128.     HUD.Message( "VictoryCondition" , "SetText", "Squash the Squad Leader Invasion!"  ); -- Kill 500 Invaders
  129.     HUD.Message( "LossCondition" , "SetText", "If the Tower falls you lose." );
  130.         
  131.     TraitorCanBeHidden = true
  132.  
  133. end
  134.  
  135. LevelStartup()
  136.  
  137. function LevelIntro()
  138.     
  139.     local tempPos = Tower.GetPosition()
  140.     Camera.LookAtPosition( tempPos )
  141.  
  142.     gameStartTime = GameTime;
  143.  
  144.     ColorTextPopup( "Level 9: Final Front", Color(1,1,1,1) )
  145.  
  146.     G.DisableTrapAll()
  147.         
  148.     G.EnableTrap("wall");
  149.     G.EnableTrap("bomb");
  150.     G.EnableTrap("hammer");
  151.     G.EnableTrap("fan");
  152.     G.EnableTrap("spring");
  153.     G.EnableTrap("zapper");
  154.     G.EnableTrap("vortex");
  155.     G.EnableTrap("axe");
  156.     G.EnableTrap("poison");
  157.     G.EnableTrap("flame");
  158.     G.EnableTrap("bulb");
  159.     G.EnableTrap("laser");
  160.  
  161.     DisableTraitor()
  162.     GameWait(1.5)
  163.  
  164. end
  165.  
  166. function LevelSequence()
  167.     
  168.     -- 1st Have a tower and some walls and let the Basic guys attack.
  169.     Traitor.SetGuiPosition( "TraitorWindow"  , Vector3(0.6, -0.5, 1) );
  170.     
  171.     -- Set the spawn points
  172.     
  173.     SpawnPoints = {}
  174.     --SpawnPoints[1] = 
  175.     
  176.     -- Start Spawning the guys
  177.     StartWave = createSpawnStruct()
  178.     
  179.     StartWave.Prob.Basic    = 1.5;
  180.     StartWave.Prob.Miner    = 2.5;
  181.     StartWave.Prob.Squad    = 2.0;
  182.     
  183.     StartWave.SpawnSpeed    = 3.0;
  184.     StartWave.MaxSpawn        = 15;
  185.     StartWave.TotalSpawn    = 25;
  186.     StartWave.GroupPercent    = 0.45;
  187.     StartWave.GroupSize        = 1;
  188.     StartWave.WhereToSpawn    = SmallCircleAroundTower
  189.     
  190.     MainWave = createSpawnStruct()
  191.     
  192.     MainWave.Prob.Basic        = 2.0;
  193.     MainWave.Prob.Miner        = 2.0;
  194.     MainWave.Prob.Stacker    = 1.5;
  195.     MainWave.Prob.Driller    = 1.0;
  196.     MainWave.Prob.Ninja        = 2.0;
  197.     MainWave.Prob.Kamikaze    = 1.5;
  198.     MainWave.Prob.Psychic    = 1.0;
  199.     MainWave.Prob.Squad        = 0.5;
  200.     MainWave.Prob.Spiker    = 1.0;
  201.     MainWave.Prob.Bomber    = 1.0;
  202.     
  203.     MainWave.SpawnSpeed        = 2.0;
  204.     MainWave.MaxSpawn        = 30;
  205.     MainWave.TotalSpawn        = 50;
  206.     MainWave.GroupPercent    = 0.15;
  207.     MainWave.GroupSize        = 1;
  208.     MainWave.WhereToSpawn    = SmallCircleAroundTower
  209.     
  210.     TraitorTalk("I think the Invaders have met their match.");
  211.     GameWait(7)
  212.     TraitorTalk("If we can survive today, I think we'll be in the clear.");
  213.     GameWait(6)
  214.     TraitorTalk("They'll be throwing everything at us now...");
  215.     GameWait(2)
  216.  
  217.     StartCinematic()
  218.         SquadCinematic()
  219.     EndCinematic()    
  220.  
  221.     InvaderTextPopup( "Squad Leader" );
  222.     GameWait(2)    
  223.     
  224. --    TraitorTalk("They mean business. They've brought in the Squad Leaders.")
  225. --    GameWait(6)
  226. --    TraitorTalk("These invaders are able to rally nearby invaders and form up squads.")
  227. --    GameWait(6)
  228. --    TraitorTalk("This enables them to attack a single point en masse.")
  229. --    GameWait(5)
  230.     TraitorTalk("I have a few more traps for 'ya.  Just hold out while I get them ready.")
  231.     G.EarnPoints(500)
  232.     GameWait(6)
  233.     
  234.     TraitorTalk("Here they come!");
  235.     GameWait(3)
  236.     AddWave( "StartAttack", StartWave )
  237.     G.SetMaxKills( 40 )
  238.     
  239.     InvadersKilledWait(40)
  240.     StopWave( "StartAttack" )
  241.     
  242.     GameWait(3)
  243.     TrapTextPopup("Satellite Laser")
  244.     G.EarnPoints( 200 )
  245.     G.EnableTrap("satellite");
  246.  
  247.     TraitorTalk("Uplink established!  You now have access to the satellite laser!")
  248.     GameWait(5)
  249.     TraitorTalk("After deploying the receiver, you will be able to aim the laser at anywhere on the map.")
  250.     GameWait(7)
  251.     TraitorTalk("Each time it fires it costs money, so be sure to watch your funds while you use it!")
  252.     GameWait(7)
  253.     TraitorTalk("You can get rid of the laser by pressing the right mouse button at any time, or if the receiver is destroyed.")
  254.     GameWait(10)
  255.     
  256.     AddWave( "MainAttack", MainWave)
  257.     G.SetMaxKills( 90 )
  258.     InvadersKilledWait(90)   --75
  259.     StopWave( "MainAttack" )
  260.     
  261.     G.Create( "Data/LightSnowCell.xml" );            -- START SNOWING:
  262.  
  263.     TraitorTalk("Great, now it's started snowing!")
  264.     GameWait(4)
  265.  
  266.     
  267. --    TraitorTalk("Alright, I have the last trap ready!")
  268. --    GameWait(3)
  269.     
  270. --    TrapTextPopup("Missile")
  271. --    G.EarnPoints( 300 )
  272. --    G.EnableTrap("missile");
  273. --    GameWait(3)    
  274.     
  275. --    TraitorTalk("All the codes are set.  The missiles are awaiting your orders.")
  276. --    GameWait(5)
  277. --    TraitorTalk("Place the silo where you want the missile to hit.")
  278. --    GameWait(4)
  279. --    TraitorTalk("And be sure to put it far away from the base!  It'll hit them and us!!!")
  280. --    GameWait(6)
  281. --    TraitorTalk("Well, I think I've helped you as much as I can. Good Luck!")
  282. --    GameWait(10)
  283.     
  284.     G.SetMaxKills( 190 )
  285.     MainWave.TotalSpawn = 100
  286.     AddWave( "MainAttack", MainWave )
  287.     InvadersKilledWait( 190 )    --175
  288.     
  289.     TraitorTalk("Quick!  Build up our defenses!!")
  290.     
  291.     G.EarnPoints( 200 )
  292.     GameWait(30)
  293.     
  294.     TraitorTalk("Here comes another wave.  Brace yourself!")
  295.     GameWait(6)
  296.     
  297.     G.SetMaxKills( 300 ) --300
  298.     MainWave.TotalSpawn = 110
  299.     MainWave.SpawnSpeed = 3.0
  300.     
  301.     WaitForTimeOrKills( 5000, 300 )
  302.     
  303.     TraitorTalk("I can see them coming.  There's so many...")
  304.     GameWait(7)
  305.     TraitorTalk("Set up what you can, although I don't think we'll survive this.")
  306.     GameWait(7)
  307.     G.EarnPoints( 200 )
  308.     TraitorTalk("Here, this is the last of the emergency funds.")
  309.     GameWait(20)
  310.     TraitorTalk("Here they come.  I believe this is the end...")
  311.     GameWait(10)
  312.     
  313.     G.SetMaxKills( 500 )
  314.     MainWave.Prob.Kamikaze = 4
  315.     MainWave.TotalSpawn = 200
  316.     MainWave.SpawnSpeed = 4.0
  317.     
  318.     InvadersKilledWait(490)
  319.     TraitorTalk("I think the attack is dying down...")
  320.     GameWait(4)
  321.     
  322.     InvadersKilledWait(500)
  323.     
  324.     TraitorTalk("Congratulations! We survived!!!!")
  325.     GameWait(5)
  326.  
  327.     TraitorTalk("That was the main invasion force, there won't be many invaders left now.")
  328.     GameWait(7)
  329.  
  330.     G.SetGameState( Victory );
  331.  
  332.     TraitorTalk("They'll probably launch one more attack, but I've got something special planned for them ...")
  333.     GameWait(7)
  334.     
  335. --[[    
  336.     TraitorTalk("That looks like the last of them.  Won't be seeing much of them anytime soon.")
  337.     GameWait(8)
  338.     TraitorTalk("Whew, we've been through a lot together, don't you agree?")
  339.     GameWait(6)
  340.     TraitorTalk("It's nice to know that I'm on the winning side!")
  341.     GameWait(5)
  342.     TraitorTalk("As a show of gratitude, I promise to be your loyal friend and ally...")
  343.     GameWait(7)
  344.     DisableTraitor()
  345.     GameWait(3)
  346.     
  347.     TraitorTalk("...for now.")
  348.     GameWait(3)
  349. ]]--            
  350.     -- G.SetGameState( Victory );
  351.     
  352. end
  353.  
  354. levelRoutine = coroutine.create(LevelIntro);
  355.  
  356. GMain["LevelUpdate"] = LevelUpdate;
  357.